Skip to content

Allow "Copy to clipboard" button to be enabled on a per fund/lab basis - #5092

Open
wes-otf wants to merge 2 commits into
mainfrom
enhancement/optional-copy-qs-to-clipboard
Open

wes-otf wants to merge 2 commits into
mainfrom
enhancement/optional-copy-qs-to-clipboard

Conversation

@wes-otf

@wes-otf wes-otf commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Added a checkbox similar to the "List on front page" check that shows or hides the "Copy questions to clipboard" button. OTF has been experimenting with getting less "vibe coded" applications and wanted to see if this would assist in any way with ease of prompting. This is allowed by default, so no by default no existing functionality is changed.

Test Steps

  • Ensure that when the "Make questions copyable to clipboard" checkbox is marked, the button shows up & is functional
  • Ensure that when the "Make questions copyable to clipboard" checkbox is not marked, no button shows up & the associated JS does not load.

@wes-otf wes-otf added Type: Enhancement This is an improvement of an existing thing (not a new thing, which would be a feature). Type: Minor Minor change, used in release drafter labels Dec 4, 2026

@frjo frjo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets hope this help.

Some minor things only.

name="allow_copying_to_clipboard",
field=models.BooleanField(
default=True,
help_text='Should the lab\'s application form be copiable to clipboard via the "Copy to clipboard" button.',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should say "fund" and not "lab" I think.

_("Make questions copyable to clipboard"),
default=True,
help_text=_(
'Should the lab\'s application form be copyable to clipboard via the "Copy to clipboard" button.'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should say "fund" and not "lab" I think.

data-copy-btn-title="{% trans 'Copies all the questions and user input to the clipboard in plain text.' %}"
data-copy-word-limit="{% trans 'Limit this field to %s words.' %}"
data-copy-selected="{% trans '(selected)' %}"
{% if page.get_parent.specific.allow_copying_to_clipboard %}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To cache add this to def fund():

@cached_property
def allow_copying_to_clipboard(self):
  return self.fund.specific.allow_copying_to_clipboard

And then use "{% if page.allow_copying_to_clipboard %}".

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Enhancement This is an improvement of an existing thing (not a new thing, which would be a feature). Type: Minor Minor change, used in release drafter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants